/*
 *
 *    Copyright (c) 2022 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP
// This file is generated from clusters-Commands.h.zapt

#pragma once

#include <app/data-model/DecodableList.h>
#include <app/data-model/Encode.h>
#include <app/data-model/List.h>
#include <app/data-model/NullObject.h>
#include <app/data-model/Nullable.h>
#include <lib/core/DataModelTypes.h>
#include <lib/core/Optional.h>
#include <lib/core/TLV.h>
#include <lib/support/BitMask.h>

#include <clusters/shared/Enums.h>
#include <clusters/shared/Structs.h>

#include <clusters/NetworkCommissioning/ClusterId.h>
#include <clusters/NetworkCommissioning/CommandIds.h>
#include <clusters/NetworkCommissioning/Enums.h>
#include <clusters/NetworkCommissioning/Structs.h>

#include <cstdint>

namespace chip
{
namespace app
{
	namespace Clusters
	{
		namespace NetworkCommissioning
		{
			namespace Commands
			{
				// Forward-declarations so we can reference these later.

				namespace ScanNetworks
				{
					struct Type;
					struct DecodableType;
				} // namespace ScanNetworks

				namespace ScanNetworksResponse
				{
					struct Type;
					struct DecodableType;
				} // namespace ScanNetworksResponse

				namespace AddOrUpdateWiFiNetwork
				{
					struct Type;
					struct DecodableType;
				} // namespace AddOrUpdateWiFiNetwork

				namespace AddOrUpdateThreadNetwork
				{
					struct Type;
					struct DecodableType;
				} // namespace AddOrUpdateThreadNetwork

				namespace RemoveNetwork
				{
					struct Type;
					struct DecodableType;
				} // namespace RemoveNetwork

				namespace NetworkConfigResponse
				{
					struct Type;
					struct DecodableType;
				} // namespace NetworkConfigResponse

				namespace ConnectNetwork
				{
					struct Type;
					struct DecodableType;
				} // namespace ConnectNetwork

				namespace ConnectNetworkResponse
				{
					struct Type;
					struct DecodableType;
				} // namespace ConnectNetworkResponse

				namespace ReorderNetwork
				{
					struct Type;
					struct DecodableType;
				} // namespace ReorderNetwork

				namespace QueryIdentity
				{
					struct Type;
					struct DecodableType;
				} // namespace QueryIdentity

				namespace QueryIdentityResponse
				{
					struct Type;
					struct DecodableType;
				} // namespace QueryIdentityResponse

			} // namespace Commands

			namespace Commands
			{
				namespace ScanNetworks
				{
					enum class Fields : uint8_t {
						kSsid = 0,
						kBreadcrumb = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::ScanNetworks::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						Optional<DataModel::Nullable<chip::ByteSpan>> ssid;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							ScanNetworksResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::ScanNetworks::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						Optional<DataModel::Nullable<chip::ByteSpan>> ssid;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace ScanNetworks
				namespace ScanNetworksResponse
				{
					enum class Fields : uint8_t {
						kNetworkingStatus = 0,
						kDebugText = 1,
						kWiFiScanResults = 2,
						kThreadScanResults = 3,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::ScanNetworksResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						Optional<DataModel::List<
							const Structs::WiFiInterfaceScanResultStruct::Type>>
							wiFiScanResults;
						Optional<DataModel::List<
							const Structs::ThreadInterfaceScanResultStruct::Type>>
							threadScanResults;

						CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
								  TLV::Tag aTag) const;

						using ResponseType = DataModel::NullObjectType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::ScanNetworksResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						Optional<DataModel::DecodableList<
							Structs::WiFiInterfaceScanResultStruct::DecodableType>>
							wiFiScanResults;
						Optional<DataModel::DecodableList<
							Structs::ThreadInterfaceScanResultStruct::DecodableType>>
							threadScanResults;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace ScanNetworksResponse
				namespace AddOrUpdateWiFiNetwork
				{
					enum class Fields : uint8_t {
						kSsid = 0,
						kCredentials = 1,
						kBreadcrumb = 2,
						kNetworkIdentity = 3,
						kClientIdentifier = 4,
						kPossessionNonce = 5,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::AddOrUpdateWiFiNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan ssid;
						chip::ByteSpan credentials;
						Optional<uint64_t> breadcrumb;
						Optional<chip::ByteSpan> networkIdentity;
						Optional<chip::ByteSpan> clientIdentifier;
						Optional<chip::ByteSpan> possessionNonce;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							NetworkConfigResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::AddOrUpdateWiFiNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan ssid;
						chip::ByteSpan credentials;
						Optional<uint64_t> breadcrumb;
						Optional<chip::ByteSpan> networkIdentity;
						Optional<chip::ByteSpan> clientIdentifier;
						Optional<chip::ByteSpan> possessionNonce;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace AddOrUpdateWiFiNetwork
				namespace AddOrUpdateThreadNetwork
				{
					enum class Fields : uint8_t {
						kOperationalDataset = 0,
						kBreadcrumb = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::AddOrUpdateThreadNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan operationalDataset;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							NetworkConfigResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::AddOrUpdateThreadNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan operationalDataset;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace AddOrUpdateThreadNetwork
				namespace RemoveNetwork
				{
					enum class Fields : uint8_t {
						kNetworkID = 0,
						kBreadcrumb = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::RemoveNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan networkID;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							NetworkConfigResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::RemoveNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan networkID;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace RemoveNetwork
				namespace NetworkConfigResponse
				{
					enum class Fields : uint8_t {
						kNetworkingStatus = 0,
						kDebugText = 1,
						kNetworkIndex = 2,
						kClientIdentity = 3,
						kPossessionSignature = 4,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::NetworkConfigResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						Optional<uint8_t> networkIndex;
						Optional<chip::ByteSpan> clientIdentity;
						Optional<chip::ByteSpan> possessionSignature;

						CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
								  TLV::Tag aTag) const;

						using ResponseType = DataModel::NullObjectType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::NetworkConfigResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						Optional<uint8_t> networkIndex;
						Optional<chip::ByteSpan> clientIdentity;
						Optional<chip::ByteSpan> possessionSignature;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace NetworkConfigResponse
				namespace ConnectNetwork
				{
					enum class Fields : uint8_t {
						kNetworkID = 0,
						kBreadcrumb = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::ConnectNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan networkID;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							ConnectNetworkResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::ConnectNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan networkID;
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace ConnectNetwork
				namespace ConnectNetworkResponse
				{
					enum class Fields : uint8_t {
						kNetworkingStatus = 0,
						kDebugText = 1,
						kErrorValue = 2,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::ConnectNetworkResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						DataModel::Nullable<int32_t> errorValue;

						CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
								  TLV::Tag aTag) const;

						using ResponseType = DataModel::NullObjectType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::ConnectNetworkResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						NetworkCommissioningStatusEnum networkingStatus =
							static_cast<NetworkCommissioningStatusEnum>(0);
						Optional<chip::CharSpan> debugText;
						DataModel::Nullable<int32_t> errorValue;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace ConnectNetworkResponse
				namespace ReorderNetwork
				{
					enum class Fields : uint8_t {
						kNetworkID = 0,
						kNetworkIndex = 1,
						kBreadcrumb = 2,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::ReorderNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan networkID;
						uint8_t networkIndex = static_cast<uint8_t>(0);
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							NetworkConfigResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::ReorderNetwork::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan networkID;
						uint8_t networkIndex = static_cast<uint8_t>(0);
						Optional<uint64_t> breadcrumb;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace ReorderNetwork
				namespace QueryIdentity
				{
					enum class Fields : uint8_t {
						kKeyIdentifier = 0,
						kPossessionNonce = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::QueryIdentity::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan keyIdentifier;
						Optional<chip::ByteSpan> possessionNonce;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;

						using ResponseType = Clusters::NetworkCommissioning::Commands::
							QueryIdentityResponse::DecodableType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::QueryIdentity::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}
						static constexpr bool kIsFabricScoped = false;

						chip::ByteSpan keyIdentifier;
						Optional<chip::ByteSpan> possessionNonce;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace QueryIdentity
				namespace QueryIdentityResponse
				{
					enum class Fields : uint8_t {
						kIdentity = 0,
						kPossessionSignature = 1,
					};

					struct Type {
					public:
						// Use GetCommandId instead of commandId directly to avoid naming
						// conflict with CommandIdentification in ExecutionOfACommand
						static constexpr CommandId GetCommandId()
						{
							return Commands::QueryIdentityResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan identity;
						Optional<chip::ByteSpan> possessionSignature;

						CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
								  TLV::Tag aTag) const;

						using ResponseType = DataModel::NullObjectType;

						static constexpr bool MustUseTimedInvoke() { return false; }
					};

					struct DecodableType {
					public:
						static constexpr CommandId GetCommandId()
						{
							return Commands::QueryIdentityResponse::Id;
						}
						static constexpr ClusterId GetClusterId()
						{
							return Clusters::NetworkCommissioning::Id;
						}

						chip::ByteSpan identity;
						Optional<chip::ByteSpan> possessionSignature;

						CHIP_ERROR Decode(TLV::TLVReader &reader);
					};
				}; // namespace QueryIdentityResponse
			} // namespace Commands
		} // namespace NetworkCommissioning
	} // namespace Clusters
} // namespace app
} // namespace chip
